package com.nfit.web.categories;

import com.nfit.entity.Categories;
import com.nfit.entity.vo.ResponeVo;
import com.nfit.service.CategoriesService;
import com.nfit.service.impl.categories.CategoriesServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.nfit.entity.vo.ResponeVo.success;

@RestController
public class CategoriesController {
    @Autowired
    private CategoriesService service;

    @RequestMapping("categories/all")
    public ResponeVo getAllCategories() {
        return success(service.getCategories());
    }
}
